//
//  NameRepository.h
//  迭代器模式
//
//  Created by flannery on 2018/12/17.
//  Copyright © 2018年 flannery. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@protocol Iterator <NSObject>

-(BOOL) hasNext;
-(id) next;

@end

@protocol Container <NSObject>

-(id<Iterator>)getIterator;

@end

@interface NameRepository : NSObject <Container>
-(id<Iterator>)getIterator;
@end

@interface NameIterator : NSObject <Iterator>
- (instancetype)initWithArray:(NSArray*)array;
@end

NS_ASSUME_NONNULL_END
